Technical details
library(GeoPressureR)
library(leaflet)
library(leaflet.extras)
library(raster)
library(dplyr)
library(ggplot2)
library(kableExtra)
library(plotly)
library(GeoLocTools)
setupGeolocation()
knitr::opts_chunk$set(echo = FALSE)
load(paste0("../data/1_pressure/", params$gdl_id, "_pressure_prob.Rdata"))
# load(paste0("../data/2_light/", params$gdl_id, "_light_prob.Rdata"))
load(paste0("../data/3_static/", params$gdl_id, "_static_prob.Rdata"))
load(paste0("../data/4_basic_graph/", params$gdl_id, "_basic_graph.Rdata"))
col <- rep(RColorBrewer::brewer.pal(8, "Dark2"), times = ceiling(max(pam$sta$sta_id) / 8))
All the results produced here are generated with (1) the raw geolocator data, (2) the labeled files of pressure and light and (3) the parameters listed below.
kable(gpr) %>% scroll_box(width = "100%")
| gdl_id | crop_start | crop_end | thr_dur | extent_N | extent_W | extent_S | extent_E | map_scale | map_max_sample | map_margin | prob_map_s | prob_map_s_calib | prob_map_thr | shift_k | kernel_adjust | calib_lon | calib_lat | calib_1_start | calib_1_end | calib_2_start | calib_2_end | calib_2_lon | calib_2_lat | prob_light_w | thr_prob_percentile | thr_gs | thr_as | low_speed_fix | ringNo | scientific_name | common_name | mass | wing_span | color |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| CB594 | 2021-06-15 | 2022-05-21 | 0 | 35 | -85 | 20 | -75 | 10 | 300 | 30 | 0.8 | NA | 0.9 | 0 | 1.4 | -80.44798 | 32.76806 | 2021-06-16 | 2021-08-10 | NA | NA | NA | NA | 0.1 | 0.9 | 120 | 100 | 15 | NA | Limnothlypis swainsonii | Swainson’s Warbler | NA | NA | NA |
The labeling of pressure data is illustrated with this figure. The black dots indicates the pressure datapoint not considered in the matching. Each stationary period is illustrated by a different colored line.
pressure_na <- pam$pressure %>%
mutate(obs = ifelse(isoutliar | sta_id == 0, NA, obs))
p <- ggplot() +
geom_line(data = pam$pressure, aes(x = date, y = obs), colour = "grey") +
geom_point(data = subset(pam$pressure, isoutliar), aes(x = date, y = obs), colour = "black") +
# geom_line(data = pressure_na, aes(x = date, y = obs, color = factor(sta_id)), size = 0.5) +
geom_line(data = do.call("rbind", shortest_path_timeserie) %>% filter(sta_id > 0), aes(x = date, y = pressure0, col = factor(sta_id))) +
theme_bw() +
scale_colour_manual(values = col) +
scale_y_continuous(name = "Pressure(hPa)")
ggplotly(p, dynamicTicks = T) %>% layout(showlegend = F)
sp_pressure <- do.call("rbind", shortest_path_timeserie) %>% filter(sta_id > 0)
sta_plot <- which(difftime(pam$sta$end, pam$sta$start, unit = "days") > 3)
par(mfrow = c(2, 3))
for (i in seq_len(length(sta_plot))) {
i_s <- sta_plot[i]
pressure_s <- pam$pressure %>%
filter(sta_id == i_s & !isoutliar)
err <- pressure_s %>%
left_join(sp_pressure, by = c("date","obs")) %>%
mutate(
err = obs - pressure - mean(obs - pressure, na.rm=T)
) %>%
.$err
hist(err, freq = F, main = paste0("sta_id=", i_s, " | ", nrow(pressure_s), " dtpts | std=", round(sd(err, na.rm=T), 2)))
xfit <- seq(min(err, na.rm=T), max(err, na.rm=T), length = 40)
yfit <- dnorm(xfit, mean = mean(err, na.rm=T), sd = sd(err, na.rm=T))
lines(xfit, yfit, col = "red")
}
| sta_id | start | end |
|---|---|---|
| 1 | 2021-06-15 17:08:39 | 2021-08-06 16:38:39 |
| 2 | 2021-08-06 18:08:39 | 2021-09-23 23:38:39 |
| 3 | 2021-09-24 11:08:39 | 2021-09-24 23:38:39 |
| 4 | 2021-09-25 07:38:39 | 2021-09-25 10:38:39 |
| 5 | 2021-09-25 12:38:39 | 2021-09-26 00:38:39 |
| 6 | 2021-09-26 02:08:39 | 2022-04-02 00:38:39 |
| 7 | 2022-04-02 10:38:39 | 2022-04-04 00:38:39 |
| 8 | 2022-04-04 07:38:39 | 2022-04-05 00:08:39 |
| 9 | 2022-04-05 09:38:39 | 2022-04-05 23:08:39 |
| 10 | 2022-04-06 00:08:39 | 2022-05-20 23:38:39 |